/**
 * 
 */
package cn.dgfy.MyBatisStudy.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.dgfy.MyBatisStudy.bean.Student;
import cn.dgfy.MyBatisStudy.service.StudentService;

/**
 * @author Tearfalls
 *
 */
@Controller
public class StudentController {
	
	@Autowired
	private StudentService studentService;
	
	@RequestMapping("/getStudents")
	public String get(Map<String, Object> map) {
		List<Student> students = studentService.get();
		map.put("students", students);
		
		return "student_list";
	}
	
	@RequestMapping("/testAddStudentsBatch")
	@ResponseBody
	public String testAddBatch() {
		studentService.testAddBatch3();
		studentService.testAddBatch4();
		
		return "OK!";
	}
}
